import React, {Component} from 'react';

const allMessages = [
    {id: 1, title: "message001",content: "content001"},
    {id: 2, title: "message002",content: "content002"},
    {id: 3, title: "message003",content: "content003"},
];

export default class MessageDetail extends Component {
    render() {
        const {id}=this.props.match.params
        const message =allMessages.find((msg) => msg.id === id*1)
        console.log(id);
        console.log(message);
        return(
            <ul>
                <li>ID:{message.id}</li>
                <li>TITLE:{message.title}</li>
                <li>CONTENT:{message.content}</li>
            </ul>
        )
    }


}
